<script setup lang="ts">
  import {useStores} from "@/store";
  import {storeToRefs} from "pinia";
  import {
    Check,
    Delete,
    Edit,
    Message,
    Search,
    Star,
  } from '@element-plus/icons-vue';
  const {counter} =useStores();
  const {count} = storeToRefs(counter); // 解构写法需要使用toRefs，否则响应式会失效
  const {increment, decrement} = counter;
</script>

<template>
home -- <div>{{count}}</div>
  <button @click="increment(1)">+</button>
  <button @click="decrement(1)">-</button>
  <div>
    <el-button :icon="Search" circle />
    <el-button type="primary" :icon="Edit" circle />
    <el-button type="success" :icon="Check" circle />
    <el-button type="info" :icon="Message" circle />
    <el-button type="warning" :icon="Star" circle />
    <el-button type="danger" :icon="Delete" circle />
  </div>
</template>

<style scoped lang="scss">

</style>